local Skill = Class(function(self, inst)
	self.inst = inst

	self.dodge_max = TUNING.RG_DODGE_DEFAULT_CD
	self.dodge_ignore_cd = false
	self.dodge_left = 0
	self.dodge_timeout = TUNING.RG_DODGE_DEFAULT_TIMEOUT

	self.aaa = nil
end)

function Skill:CanDodge()
	local inst = self.inst
	if inst.components.driver ~= nil and inst.components.driver:GetIsDriving() then
		return false
	elseif inst.components.rider ~= nil and inst.components.rider:IsRiding() then
		return false
	end

	return self.dodge_ignore_cd or self.dodge_left <= 0
end

function Skill:OnDodge()
	self.dodge_left = self:GetDodgeCD()
	self.inst:StartUpdatingComponent(self)
end

function Skill:GetDodgeCD()
	-- buffs
	return self.dodge_max
end

function Skill:GetDodgeTimeout()
	-- armors
	return self.dodge_timeout
end


function Skill:OnSave()
	return {}
end

function Skill:OnLoad(data)
	if data then
		--
	end
end

function Skill:OnUpdate(dt)
	if self.dodge_left > 0 then
		self.dodge_left = self.dodge_left - dt
		if self.dodge_left <= 0 then
			self.inst:PushEvent("rgevt_dodge_ready")
		end
	end
end
return Skill